import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    name: "登录",
    component: () => import("../views/LoginView.vue"),
  },
  {
    path: "/",
    component: () => import("../views/MainView.vue"),
    redirect: "/home",
    children: [
      {
        path: "/home",
        name: "首页",
        component: () => import("../views/HomeView.vue"),
      },
      {
        path: "/record",
        name: "记录管理",
        component: () => import("../views/RecordView.vue"),
      },
      {
        path: "/equipment",
        name: "设备管理",
        component: () => import("../views/EquipmentView.vue"),
      },
      {
        path: "/personnel",
        name: "人员信息",
        component: () => import("../views/PersonnelView.vue"),
      },
      {
        path: "/post",
        name: "岗位信息",
        component: () => import("../views/PostView.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  mode: "hash",
  routes,
});

export default router;
